<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="password" name="password" id="">
    <span id="msg"></span>
    <script>
        // 流程控制语句

        document.querySelector("[name='password']").addEventListener("keyup", function () {
            let length = this.value.length;
            let msg = "";
            if (length > 10) {
                msg = "密码无敌安全"
            } else if (length > 6) {
                msg = "中级密码强度"
            } else {
                msg = "密码太弱"
            }
            document.querySelector("#msg").innerHTML = msg;
        });

        // let status = false;

        // if (status) {
        //     console.log("wfj");
        // } else {
        //     console.log("baidu.com");
        // }
    </script>
</body>

</html>